{* Smarty *}
{include file="admin/admin-header.tpl" menu_here="pages"}
<div id="main">
{if $fragment==0}
	<h1>当前页面</h1>
	<table>
		<tr>
			<td>
				<ol>
					{foreach from=$pages item=page}
						<li><a
							href="{$BASE_HOSTPATH}dr-admin/dr-page-admin-pages.php?fragment=2&pid={$page.page_id}">{$page.title}</a>
						</li>
						{foreachelse}
						<li>There is no page now, please <a
							href="{$BASE_HOSTPATH}dr-admin/dr-page-admin-pages.php?fragment=1">add
							one</a>!
						</li>
					{/foreach}
				</ol>
			</td>
		</tr>
		<tr>
			<td>
				<a href="?fragment=1">添加页面</a>
			</td>
		</tr>
	</table>

	{elseif $fragment==1}
	<h1>添加页面</h1>

	<form action="/dr-admin/dr-page-admin-pages.php" method="post">
		<input type="hidden" name="action" id="action" value="add"/>
		<table>
			<tr>
				<td>页面名称</td>
				<td><input type="text" name="title" id="title" value=""/></td>
			</tr>
			<tr>
				<td>位置</td>
				<td>
					<select id="position" name="position">
						<option value="0">----</option>
						<option>1111</option>
						<option>2222</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>页面内容</td>
				<td>
					<textarea id="content" name="content" rows="7"
					          cols="21"></textarea>
				</td>
			</tr>
		</table>
		<input type="submit" name="submit" id="submit" value="添加"/>
		<a href="?fragment=0">取消</a>
	</form>

	{elseif $fragment==2}
	<h1>编辑分类</h1>

	<form action="/dr-admin/dr-page-admin-pages.php" method="post">
		<input type="hidden" name="action" id="action" value="edit"/>
		<input type="hidden" name="page_id" id="page_id"
		       value="{$page.page_id}"/>
		<table>
			<tr>
				<td>页面名称</td>
				<td><input type="text" name="title" id="title"
				           value="{$page.title}"/></td>
			</tr>
			<tr>
				<td>位置</td>
				<td>
					<select id="position" name="position">
						<option value="0">----</option>
						<option>1111</option>
						<option>2222</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>页面内容</td>
				<td>
					<textarea id="content" name="content" rows="7"
					          cols="21">{$page.content}</textarea>
				</td>
			</tr>
		</table>
		<input id="submit" type="submit" name="submit" value="保存更改"/>
		<a href="?fragment=0">取消</a>
	</form>

{/if}
</div>
{include file="admin/admin-footer.tpl"}